package cn.iocoder.yudao.hires.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.hires.entity.ResumeUserDO;
import cn.iocoder.yudao.hires.vo.ResumeUserPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 简历-用户基本信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ResumeUserMapper extends BaseMapperX<ResumeUserDO> {

    default PageResult<ResumeUserDO> selectPage(ResumeUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ResumeUserDO>()
                .eqIfPresent(ResumeUserDO::getUserId, reqVO.getUserId())
                .likeIfPresent(ResumeUserDO::getName, reqVO.getName())
                .eqIfPresent(ResumeUserDO::getSex, reqVO.getSex())
                .eqIfPresent(ResumeUserDO::getBirthday, reqVO.getBirthday())
                .eqIfPresent(ResumeUserDO::getCity, reqVO.getCity())
                .eqIfPresent(ResumeUserDO::getWorkExperience, reqVO.getWorkExperience())
                .eqIfPresent(ResumeUserDO::getWorkExperienceName, reqVO.getWorkExperienceName())
                .eqIfPresent(ResumeUserDO::getDegree, reqVO.getDegree())
                .eqIfPresent(ResumeUserDO::getPhone, reqVO.getPhone())
                .eqIfPresent(ResumeUserDO::getMailbox, reqVO.getMailbox())
                .betweenIfPresent(ResumeUserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ResumeUserDO::getId));
    }

}